package aiku.numericalcontroloa.Controller;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Entity.Region;
import aiku.numericalcontroloa.Service.RegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 地区控制器
 * @Author 黄广庭
 * @Date 2024/5/10 16:59
 */
@RestController
@Slf4j
@RequestMapping("/region")
public class RegionController {
    private final RegionService regionService;

    public RegionController(RegionService regionService) {
        this.regionService = regionService;
    }

    /**
     * 获取联级列表
     * @return
     */
    @PostMapping("/getCascadeList")
    public Result getCascadeList(@RequestBody Region region){
        return regionService.getCascadeList(region);
    }
}
